package com.antoco.operation.bigscreen.model.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * 传感器通信记录
 */
@Entity
@Table(name = "sensor_report")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class SensorReport implements AbstractEntity<Long> , Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;

    /**
     * 传感器标识
     */
    @Column(name = "sensor_id")
    private Long sensorId;

    /**
     * 通信值
     */
    @Column(name = "report_val")
    private String reportVal;

    /**
     * 是否形成告警
     */
    @Column(name = "gen_warn")
    private String genWarn;

    /**
     * 告警标识
     */
    @Column(name = "warn_id")
    private String warnId;

    /**
     * 创建时间
     */
    @Column(name = "gen_time")
    private Timestamp genTime;

    /**
     * 记录状态
     */
    @Column(name = "rec_state")
    private String recState;

}
